package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.Comallocation;
import cn.wolfcode.crm.mapper.ComallocationMapper;
import cn.wolfcode.crm.service.IComallocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ComallocationServiceImpl implements IComallocationService {
    @Autowired
    private ComallocationMapper comallocationMapper;

    public void save(Comallocation comallocation) {
        comallocationMapper.insert(comallocation);
    }

    public void update(Comallocation comallocation) {
        comallocationMapper.updateByPrimaryKey(comallocation);
    }

    public void delete(Long id) {
        comallocationMapper.deleteByPrimaryKey(id);
    }

    public Comallocation get(Long id) {

        return comallocationMapper.selectByPrimaryKey(id);
    }

    public List<Comallocation> list() {

        return comallocationMapper.selectAll();
    }
}
